import React from "react";
import { Switch, Route, Redirect } from "react-router-dom";

import Home from "./pages/home/index";
import Detail from "./pages/detail";
import City from "./pages/city/index";
import NotFound from "./pages/notfound/index";

const App = () => {
  return (
    <Switch>
      <Redirect from="/" to="/home" exact></Redirect>
      <Route path="/home" component={Home}></Route>
      <Route path="/detail/:id" component={Detail}></Route>
      <Route path="/city" component={City}></Route>
      <Route path="*" component={NotFound}></Route>
    </Switch>
  );
};

export default App;
